import os
import sys
from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

if __name__ == '__main__':
    # app.run(host='0.0.0.0', debug=True)
    print('sys.argv:',sys.argv)
    if len(sys.argv)>1:
        print(f'服务器为：{sys.argv[1]}:5026')
        app.run(debug=True,host=sys.argv[1],port=5026)
    else:
        app.run(debug=True)
